package com.asking.service.es;

import com.asking.service.AnswerService;
import com.asking.service.QuestionService;
import com.asking.service.recommended.RecommendService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.io.IOException;

@Component
public class PromotionJob {

    @Resource
    private AnswerService answerService;
    @Resource
    private RecommendService  recommendService;
    @Resource
    private QuestionService  questionService;
    @Scheduled(cron = "0 * * * * *")
    public void execute() throws IOException {
        System.out.println("ES更新和推荐文件更新");
        recommendService.history();
        answerService.pare();
        questionService.pare();

    }

}
